<?php
namespace App\Models;

/*
 * Mock travel destination data.
 * Note that we don't have to extend CodeIgniter's model for now
 */

class player {

    //mock data : an array of records
    protected $data = [
        '1' => [
            'id' => 1,
            'name' => 'zhaorui',
            'city'=>'dongguan',
             'playernumber'=>'10',
            'introduce'=>'He is a Chinese professional basketball player and guard in the CBA Guangdong Hongyuan Basketball Club',
             'age'=>'26',
            'image' => 'zhaorui.jpg',
        ],
        '2' => [
            'id' => 2,
            'name' => 'xvjie',
            'city'=>'dongguan',
            'playernumber'=>'2',
          'introduce'=>'Since childhood, because of his height, he was despised by all people, but also because of his height,
                he worked harder than all people. He proved that basketball is not just a game for giants. 
        However, basketball is really a giants sport. At the moment, he is a giant of spirit and willpower,
                a giant of court reading ability and judgment ability, and a giant of breaking prejudices',
            'age'=>'21',
            'image' => 'xvjie.jpg',
        ],
        '3' => [
            'id' => 3,
            'name' => 'Humingxuan',
           'city'=>'dongguan',
            'playernumber'=>'3',
          'introduce'=>'Hu Mingxuan has developed into an excellent dual position player with excellent shooting ability, 
                good penetration, and excellent ball handling and passing awareness',
            'age'=>'24',
            'image' => 'Humingxuan.jpg',
        ],
        '4' => [
            'id' => 4,
            'name' => 'yijianlian',
        'city'=>'dongguan',
            'playernumber'=>'9',
          'introduce'=>'Yi Jianlian is also the CBA all-time scoring champion [13], all-time rebounding champion ,
                all-time double double champion, [14] regular season scoring champion [15], regular season rebounding champion,
                regular season double double champion, and playoff shot block champion. 
                In May 2021, China Sports Value List 2020 Chinese Athletes Communication Influence List was released on the same day, 
                and Yi Jianlian was elected as 2020 Chinas most communication influence Male athlete',
            'age'=>'38',
            'image' => 'yijianlian.jpg',
        ],
        '5' => [
            'id' => 5,
            'name' => 'mashang',
        'city'=>'dongguan',
            'playernumber'=>'6',
          'introduce'=>'He used to play in NBA. He has strong individual playing ability. His type is similar to Nick Yang, 
                and he has certain autonomous offensive ability.',
            'age'=>'34',
            'image' => 'masan.jpg',
        ],
    ];

    public function findAll() {
        return $this->data;
    }

    public function find($id = null) {
        if (!empty($id) && isset($this->data[$id])) {
            return $this->data[$id];
        }
        return null;
    }

}